'use strict';
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
    entry:  __dirname + "/app/main.js",//已多次提及的唯一入口文件
    output: {
        path: __dirname + "/public",//打包后的文件存放的地方
        filename: "bundle.js"//打包后输出文件的文件名
    },

    module: {
        loaders: [
            {test: /\.json$/, loader: "json-loader"},
            {test: /\.css$/, loader: 'style-loader!css-loader'},
            {test: /\.jpg$/,loader:'file-loader'},
            {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader',
            query: {
                presets: ['es2015','stage-0','react']
            }

        }
    ]
},

devServer: {
    contentBase: "./public",
        historyApiFallback: true,
        inline: true
},
    plugins: [
        new ExtractTextPlugin('main.css')
        ]
}